package com.qf.sm01.service.impl;

import com.qf.sm01.entity.Student;
import com.qf.sm01.mapper.StudentMapper;
import com.qf.sm01.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Service
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;
    @Override
    @Transactional(readOnly = true)
    public List<Student> showAll() {
        return studentMapper.selectAll();
    }

    @Override
    @Transactional(timeout = 100)
    public Integer removeByStuId(Integer stuId) {
        Integer delete = 0;
        delete = studentMapper.delete(stuId);
        int i = 10/0;
        return delete;
    }
}
